package com.springboot.application.advices;

import com.springboot.application.exceptions.ApiException;
import com.springboot.application.response.ResultResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ControllerExceptionAdvice {
    @ExceptionHandler({ApiException.class})
    public ResultResponse handle(ApiException e){
        return new ResultResponse(e.getResultCodeEnum());
    }
}
